package com.abss.vote.model;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 作品表
 */
public class Work implements Comparable<Work> {
    private String TIME;

    public String getTIME() {
        return TIME;
    }

    public void setTIME(String TIME) {
        this.TIME = TIME;
    }

    private List<Map<String ,String >> URL;//图片作品

    public List<Map<String, String>> getURL() {
        return URL;
    }

    public void setURL(List<Map<String, String>> URL) {
        this.URL = URL;
    }

    private String WORK_ASSESSMENT;//书评

    public String getWORK_ASSESSMENT() {
        return WORK_ASSESSMENT;
    }

    public void setWORK_ASSESSMENT(String WORK_ASSESSMENT) {
        this.WORK_ASSESSMENT = WORK_ASSESSMENT;
    }

    private Integer WORK_ID;

    private String WORK_NAME;//作品名称

    private String USER_ID;//作者ID

    private String WORK_IMGURL;//作品封面图片

    private String WORK_TYPE;//0 视频 1 音频


    private Integer WORK_LENTH;//作品长度
    private Integer IS_AWARD;//是否领奖

    public Integer getIS_AWARD() {
        return IS_AWARD;
    }

    public void setIS_AWARD(Integer IS_AWARD) {
        this.IS_AWARD = IS_AWARD;
    }

    private String RESOURCE_URL;//作品路径

    private Integer VOTES_NUMBER;//点赞数量

    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy年MM月dd日 HH:mm:ss")
    private Date WORK_UPTIME;//上传时间

    private Integer ACTIVITY_ID;//活动ID

    private Integer AUDIT_STATE;//默认0未审核 1 审核通过 2 审核不通过

    private String COMMENT;//审核不通过原因

    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy年MM月dd日 HH:mm:ss")
    private Date AUDIT_TIME;//审核时间

    private Integer CURRENT_STAGE;//当前阶段 审核前为0 审核通过后变成1 代表处于第一阶段 以后每进入一个新阶段 该值加 1 审核未通过为 -1

    private Integer PRIZE_ID;//获奖ID

    private String DELETED;//0 未删除 1 删除

    private int IS_SUBMIT;//是否提交

    public int getIS_SUBMIT() {
        return IS_SUBMIT;
    }

    public void setIS_SUBMIT(int IS_SUBMIT) {
        this.IS_SUBMIT = IS_SUBMIT;
    }

    private String USER_NAME;

    private String DISTRICT_NAME;
    private Integer DISTRICT_ID;

    private Integer WORK_VISIST;//浏览数

    public Integer getWORK_VISIST() {
        return WORK_VISIST;
    }

    public void setWORK_VISIST(Integer WORK_VISIST) {
        this.WORK_VISIST = WORK_VISIST;
    }

    public Integer getDISTRICT_ID() {
        return DISTRICT_ID;
    }

    public void setDISTRICT_ID(Integer DISTRICT_ID) {
        this.DISTRICT_ID = DISTRICT_ID;
    }

    public Integer getWORK_LENTH() {
        return WORK_LENTH;
    }

    public void setWORK_LENTH(Integer WORK_LENTH) {
        this.WORK_LENTH = WORK_LENTH;
    }

    public String getUSER_NAME() {
        return USER_NAME;
    }

    public void setUSER_NAME(String USER_NAME) {
        this.USER_NAME = USER_NAME;
    }

    public String getDISTRICT_NAME() {
        return DISTRICT_NAME;
    }

    public void setDISTRICT_NAME(String DISTRICT_NAME) {
        this.DISTRICT_NAME = DISTRICT_NAME;
    }

    public Integer getWORK_ID() {
        return WORK_ID;
    }

    public void setWORK_ID(Integer WORK_ID) {
        this.WORK_ID = WORK_ID;
    }

    public String getWORK_NAME() {
        return WORK_NAME;
    }

    public void setWORK_NAME(String WORK_NAME) {
        this.WORK_NAME = WORK_NAME == null ? null : WORK_NAME.trim();
    }

    public String getUSER_ID() {
        return USER_ID;
    }

    public void setUSER_ID(String USER_ID) {
        this.USER_ID = USER_ID == null ? null : USER_ID.trim();
    }

    public String getWORK_IMGURL() {
        return WORK_IMGURL;
    }

    public void setWORK_IMGURL(String WORK_IMGURL) {
        this.WORK_IMGURL = WORK_IMGURL == null ? null : WORK_IMGURL.trim();
    }

    public String getWORK_TYPE() {
        return WORK_TYPE;
    }

    public void setWORK_TYPE(String WORK_TYPE) {
        this.WORK_TYPE = WORK_TYPE == null ? null : WORK_TYPE.trim();
    }

    public String getRESOURCE_URL() {
        return RESOURCE_URL;
    }

    public void setRESOURCE_URL(String RESOURCE_URL) {
        this.RESOURCE_URL = RESOURCE_URL == null ? null : RESOURCE_URL.trim();
    }

    public Integer getVOTES_NUMBER() {
        return VOTES_NUMBER;
    }

    public void setVOTES_NUMBER(Integer VOTES_NUMBER) {
        this.VOTES_NUMBER = VOTES_NUMBER;
    }

    public Date getWORK_UPTIME() {

        return WORK_UPTIME;
    }
    public String getFORMATTED_WORK_UPTIME(){
        return new SimpleDateFormat("yyyy年MM月dd日 hh时mm分ss秒").format(WORK_UPTIME);
    }

    public void setWORK_UPTIME(Date WORK_UPTIME) {
        this.WORK_UPTIME = WORK_UPTIME;
    }

    public Integer getACTIVITY_ID() {
        return ACTIVITY_ID;
    }

    public void setACTIVITY_ID(Integer ACTIVITY_ID) {
        this.ACTIVITY_ID = ACTIVITY_ID;
    }

    public Integer getAUDIT_STATE() {
        return AUDIT_STATE;
    }

    public void setAUDIT_STATE(Integer AUDIT_STATE) {
        this.AUDIT_STATE = AUDIT_STATE;
    }

    public String getCOMMENT() {
        return COMMENT;
    }

    public void setCOMMENT(String COMMENT) {
        this.COMMENT = COMMENT == null ? null : COMMENT.trim();
    }

    public Date getAUDIT_TIME() {
        return AUDIT_TIME;
    }

    public void setAUDIT_TIME(Date AUDIT_TIME) {
        this.AUDIT_TIME = AUDIT_TIME;
    }

    public Integer getCURRENT_STAGE() {
        return CURRENT_STAGE;
    }

    public void setCURRENT_STAGE(Integer CURRENT_STAGE) {
        this.CURRENT_STAGE = CURRENT_STAGE;
    }

    public Integer getPRIZE_ID() {
        return PRIZE_ID;
    }

    public void setPRIZE_ID(Integer PRIZE_ID) {
        this.PRIZE_ID = PRIZE_ID;
    }

    public String getDELETED() {
        return DELETED;
    }

    public void setDELETED(String DELETED) {
        this.DELETED = DELETED == null ? null : DELETED.trim();
    }

    @Override
    public String toString() {
        return "Work{" +
                "WORK_ID=" + WORK_ID +
                ", WORK_NAME='" + WORK_NAME + '\'' +
                ", USER_ID='" + USER_ID + '\'' +
                ", WORK_IMGURL='" + WORK_IMGURL + '\'' +
                ", WORK_TYPE='" + WORK_TYPE + '\'' +
                ", WORK_LENTH=" + WORK_LENTH +
                ", RESOURCE_URL='" + RESOURCE_URL + '\'' +
                ", VOTES_NUMBER=" + VOTES_NUMBER +
                ", WORK_UPTIME=" + WORK_UPTIME +
                ", ACTIVITY_ID=" + ACTIVITY_ID +
                ", AUDIT_STATE=" + AUDIT_STATE +
                ", COMMENT='" + COMMENT + '\'' +
                ", AUDIT_TIME=" + AUDIT_TIME +
                ", CURRENT_STAGE=" + CURRENT_STAGE +
                ", PRIZE_ID=" + PRIZE_ID +
                ", DELETED='" + DELETED + '\'' +
                ", USER_NAME='" + USER_NAME + '\'' +
                ", DISTRICT_NAME='" + DISTRICT_NAME + '\'' +
                '}';
    }

    @Override
    public int compareTo(Work o) {
        if (this.VOTES_NUMBER>o.VOTES_NUMBER){
            return -1;
        }else if (this.VOTES_NUMBER<o.VOTES_NUMBER){
            return 1;
        }else {

            return 0;
        }
    }
}